import request from './request'

// 首页数据的请求
export const GetHomeList = () => request.get("/index/index")

// 获取搜索弹出框的数据
export const GetSearchPopuData = () => request.get("/search/index")

// 获取实时搜索的数据的列表
// export const GetSearchTipsListData = (xxx) => request.get("/search/helper", {
//   params:xxx
// })
export const GetSearchTipsListData = params => request.get("/search/helper", {
  params
})

// 搜索商品列表数据
export const GetGoodsListData = params => request.get("/goods/list", {
  params
})

// 清除历史记录
export const ClearHistory = () => request.post("/search/clearhistory")


// 登录请求
export const GoLogin = (params) => request.post("/auth/loginByWeb", params)


// 商品详情
export const GetGoodsDetail = params => request.get("/goods/detail", {
  params
})


// 相关产品
export const GetGoodsReletedDetail = params => request.get("/goods/related", {
  params
})

// 获取购物车产品数量
export const GetGoodsCount = () => request.get("/cart/goodscount")


// 加入购物车
export const AddProductToCart = (params) => request.post("/cart/add", params)


// 获取购物车数据
export const GetCartListData = () => request.get("/cart/index")

// 点击切换商品选中状态（含全选）
export const ChangeGoodChecked = (params) => request.post("/cart/checked", params)


// 步进器
export const StepperChangeData = (params) => request.post("/cart/update", params)


// 购物车删除商品
export const DeleteGood = (params) => request.post("/cart/delete", params)